package com.file.manage.domain.entity.convertor;


import com.file.manage.domain.data.FileVO;
import com.file.manage.domain.data.UserInfo;
import com.file.manage.domain.entity.File;
import com.file.manage.domain.entity.User;
import com.file.manage.domain.service.impl.FileServiceImpl;
import io.swagger.v3.oas.annotations.media.Schema;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author H41
 * @Type UserConvertor.java
 * @date 2025/5/30 23:49
 * @Desc 文件转换器
 */

@Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface FileConvertor {
    FileConvertor INSTANCE = Mappers.getMapper(FileConvertor.class);
    ;

    @Mapping(source = "creatorName", target = "createdByName")
    @Mapping(source = "modifierName", target = "updatedByName")
    @Mapping(source = "fileStatusStatistics.leafFolderNoFileQty", target = "leafFolderNoFileQty")
    @Mapping(source = "fileStatusStatistics.noLockFileQty", target = "noLockFileQty")
    @Mapping(source = "fileStatusStatistics.delTagFileQty", target = "delTagFileQty")
    FileVO toFileVO(File file, String creatorName, String modifierName, FileServiceImpl.FileStatusStatistics fileStatusStatistics);

}
